package com.ruicar.afs.cloud.channel.common.feign;


import com.ruicar.afs.cloud.channel.common.condition.AddressCondition;
import com.ruicar.afs.cloud.channel.common.condition.VehicleCondition;
import com.ruicar.afs.cloud.channel.common.entity.ApplyMessage;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import com.ruicar.afs.cloud.image.entity.ComAttachmentFile;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;
import java.util.Map;

/**
 * @Author Ice
 * @Date 2020/6/9
 */
@FeignClient(name = "apply", url = "${com.greatwall.services.apply-service.url}")
public interface ChannelUseApplyService {
    @PostMapping(value = "/common/getAddressList")
    @ApiOperation("查询省市列表")
    IResponse getAddressList(@RequestBody AddressCondition condition, @RequestHeader Map<String, String> headers);


    /**
     * 授权区域
     *
     * @param headers
     * @return
     */
    @PostMapping(value = "/common/getAddressTree")
    @ApiOperation("查询授权区域")
    IResponse getAddressTree(@RequestHeader Map<String, String> headers);


    /**
     * 授权车型、主营品牌
     *
     * @param condition
     * @param headers
     * @return
     */
    @PostMapping(value = "/vehicle/getCarTree")
    @ApiOperation("查询授权车型")
    IResponse getCarTree(@RequestBody VehicleCondition condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/contract/queryWitnessIdCard")
    @ApiOperation("通过身份证号查询有没有正在见证的信息")
    IResponse queryWitnessIdCard(@RequestBody List<String> condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/message/save")
    @ApiOperation("添加消息通知")
    IResponse saveMessage(@RequestBody List<ApplyMessage> condition, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/applyUserChannel/syncFileToApply")
    @ApiOperation("同步影像件到进件服务")
    void syncFileToApply(List<ComAttachmentFile> list, @RequestHeader Map<String, String> headers);
}
